﻿//************************************************************ 
// Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich
// To learn more about Mytrip.Mvc.Entyty visit 
// http://starterkitmytripmvc.codeplex.com/
// mytripmvc@gmail.com
// license: Microsoft Public License (Ms-PL) 
// ***********************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Configuration;

namespace Mytrip.Users
{
    /// <summary>
    /// Users Setting
    /// </summary>
    public class UsersSetting
    {
        /// <summary>
        /// Name Connection String
        /// </summary>
        public static string connectionStringName = ConfigurationManager.AppSettings["connectionStringName"];
        /// <summary>
        /// Connection String
        /// </summary>
        public static string connectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
        /// <summary>
        /// Minimum Required Password Length
        /// </summary>
        public static int minRequiredPasswordLength = int.Parse(ConfigurationManager.AppSettings["minRequiredPasswordLength"]);
        /// <summary>
        /// Maximum Invalid Password Attempts
        /// </summary>
        public static int maxInvalidPasswordAttempts = int.Parse(ConfigurationManager.AppSettings["maxInvalidPasswordAttempts"]);
        /// <summary>
        /// Name Http Host
        /// </summary>
        public static string applicationName = HttpContext.Current.Request.ServerVariables["HTTP_HOST"];
        /// <summary>
        /// Requires Unique Email
        /// </summary>
        public static bool requiresUniqueEmail = bool.Parse(ConfigurationManager.AppSettings["requiresUniqueEmail"]);
        /// <summary>
        /// Unlock Captcha
        /// </summary>
        public static bool unlockCaptcha = bool.Parse(ConfigurationManager.AppSettings["unlockCaptcha"]);
    }
}
